import configparser
class configCommon():
    # inifilePath 文件路径
    inifilePath="config/config.ini"
    #attribute属性名称  name 要取值的名称
    def getvales(attribute,name):
        config = configparser.ConfigParser()
        config.read(configCommon.inifilePath)
        vaule = config.get(attribute,name)
        return vaule


#操作ini文件的工具类  操作方法
# config = configparser.ConfigParser()
# config.read("config/config.ini")
# name = config.get("Hbase","name")
# print(name)

# try:
#     config.add_section("Hbase")
#     config.set("Hbase","name","tangjain")
#     config.set("Hbase","sex","1")
# except configparser.DuplicateSectionError:
#     print("Section 'School' already exists")
#
# config.write(open("config/config.ini", "w"))

